package com.dz.scrm.utils;

import android.util.Log;

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.handshake.ServerHandshake;

import java.net.URI;

import javax.net.ssl.SSLParameters;

/**
 * @Description: 类作用描述
 * @Author: 黄海
 * @CreateDate: 2021-4-26 15:51
 * @UpdateUser: 黄海
 * @UpdateDate: 2021-4-26 15:51
 * @UpdateRemark: 更新说明
 */
public class DZWebSocketClient extends WebSocketClient {

    public DZWebSocketClient(URI serverUri) {
        super(serverUri, new Draft_6455());
    }

    @Override
    public void onOpen(ServerHandshake handshakedata) {
        Log.e("JWebSocketClient", "onOpen()"+handshakedata.getHttpStatusMessage()+"; "+handshakedata.getHttpStatus());
//        this.send("hello  text ");
    }

    @Override
    public void onMessage(String message) {
        Log.e("JWebSocketClient", "onMessage()"+message);
    }

    @Override
    public void onClose(int code, String reason, boolean remote) {
        Log.e("JWebSocketClient", "onClose() "+reason+";code = "+code);
    }

    @Override
    public void onError(Exception ex) {
        Log.e("JWebSocketClient", "onError()" +ex.getMessage());
    }
}